package com.cloud.spock.groovy.test

import static org.junit.Assert.*

import com.cloud.spock.test.MyService
import org.junit.Test

import spock.lang.Specification

class ParamTest extends Specification{

	def "test Parameterized"() {
		when:
		MyService myService = new MyService()
		then:
		myService.add(a, b) == result
		where: "准备参数，输入参数名必须跟方法里面的参数名一致"
		a | b || result
		1 | 1 || 2
		1 | 2 || 3
		2 | 2 || 5
	}
}
